import { ADD, DELETE } from "./constant";

// 同步action
export const createAddAction = (data) => {
  return { type: ADD, data };
};
export const createDeleteAction = (data) => {
  return { type: DELETE, data };
};

// 异步action
export const createAsyncAddAction = (data, delay) => {
  return (dispatch, getState) => {
    // console.log("上一次State的值:", getState());
    setTimeout(() => {
      dispatch(createAddAction(data));
    }, delay);
  };
};
